package se.cbb.scripts;

import java.io.File;

import se.cbb.misc.SequenceFileWriter;

public class GenerateVMCMCScripts {

	public static void main(String[] args) {
		try {
			String path = "/Users/rhali/Documents/Projects/VMCMC/simRuns/";
			for(int i = 1; i < 13; i++) {
				String folderName = path + "simRun" + i + "/MCMC/Uninformed/";
				File folder = new File(folderName);
				File[] listOfFiles = folder.listFiles();
				SequenceFileWriter.writeAndAppendLine(folderName, "UninformedScript.sh", "#!/bin/bash\n");
				for(int j = 1; j < listOfFiles.length; j++) {
					String fileName = listOfFiles[j].getName();
					SequenceFileWriter.writeAndAppendLine(folderName, "UninformedScript.sh", "java -Xmx2000m -jar VMCMC-1.0.0-uber.jar /Users/rhali/Documents/Projects/VMCMC/simRuns/simRun" + i + "/MCMC/Uninformed/" + fileName + " -ct -o " + fileName + ".out");
					SequenceFileWriter.writeAndAppendLine(folderName, "UninformedScript.sh", "java -Xmx2000m -jar VMCMC-1.0.0-uber.jar /Users/rhali/Documents/Projects/VMCMC/simRuns/simRun" + i + "/MCMC/Uninformed/" + fileName + " -t -o Param" + fileName + ".out");
				}				
			}				
		} catch (Exception e) {
			System.out.println("Error : " + e.getMessage());
		}
	}

}
